Skip to content

Fix Windows hang when stdin is redirected (#907)#908

Open
rschmitt wants to merge 1 commit into
ruby:masterfrom
rschmitt:windows-hang
Open

Fix Windows hang when stdin is redirected (#907)#908
rschmitt wants to merge 1 commit into
ruby:masterfrom
rschmitt:windows-hang

Conversation

@rschmitt

Copy link
Copy Markdown

No description provided.

Comment thread lib/reline/io.rb Outdated
if io.msys_tty?
Reline::ANSI.new
elsif !STDIN.tty?
Reline::Dumb.new

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be ANSI instead of Dumb.

if io.msys_tty? || !STDIN.tty?
  Reline::ANSI.new
else
  io
end

Reline::Dumb is historically a test-mode IO, it prints many many redundant/duplicated chars and useless.
Using ANSI will align with non-windows branch: using Reline::ANSI even if STDIN is not a tty.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants